@use '@scss/common' as *;

.cmsForm {
  position: relative;
  background-color: var(--theme-bg);
  border-inline: 1px solid var(--theme-border-color);

  .fieldWrap {
    position: relative;
    border-top: 1px solid var(--theme-border-color);
    border-bottom: 1px solid var(--theme-border-color);
    width: 100%;

    &:before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 2px;
      height: 100%;
      background: var(--color-base-0);
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    &:focus-within {
      &::before {
        opacity: 1;
      }
    }

    :global {
      div.rs__control {
        border: none;
        background: none;
      }
    }

    input,
    textarea {
      border: none;
      background: none;

      &:focus {
        outline: none;
      }
    }
  }

  .captchaWrap {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--theme-border-color);
    background-color: var(--theme-bg);
  }

  .captcha {
    overflow: hidden;
    width: 300px;
    height: 76px;
    border-radius: 4px;
    border: 1px solid var(--theme-elevation-300);

    iframe {
      margin: -1px 0px 0px -2px;
    }
  }

  .submitButton {
    &::before {
      content: '';
      width: calc(100% - 2px);
      position: absolute;
      height: 100%;
      left: 1px;
      top: 0;
      z-index: 0;
      background-color: var(--theme-bg);
    }

    &:disabled::before {
      background-color: var(--theme-elevation-50);
    }
  }

  .hideTopBorder {
    border-top: 0;
  }

  .hideBottomBorder {
    border-bottom: 0;
  }

  .confirmationMessage {
    width: 100%;
    padding: 1.5rem 2rem;
    border-block: 1px solid var(--theme-border-color);
  }
}

.formFieldsWrap {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  width: 100%;

  > * {
    width: 100%;
  }

  .crosshair {
    position: absolute;
    width: 1rem;
    height: auto;
    z-index: 5;
    color: var(--theme-elevation-1000);
    opacity: 0.5;
  }

  .crosshairLeft {
    top: calc(0% - 0.5rem);
    left: calc(0% - 0.5rem);
  }
}

.hidden {
  display: none;
}
